package com.example.blew.demo.uitl;

import cn.hutool.core.util.ReflectUtil;
import org.junit.jupiter.api.Test;

import java.lang.reflect.Field;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 通过类名获取全部属性
 * </p>
 *
 * @author chaodong.zeng@pcitc.com
 * @since 2022/10/18
 */
public class GetClassAttribute {

    class Man{
        private String name;
        private int age;
    }

    public void getallAttribute(Class claz){
        Field[] fields = ReflectUtil.getFields(claz);
        List list =new ArrayList();
        for (Field field: fields)
        {
            list.add(field.getType());
        }

    }

    public void test(List list,String s){

    }

    @Test
    public void testMain(){
        System.out.println("hello");
        getallAttribute(Man.class);
    }

}